feat(starknet): add deploy_v2 syscall support#1649
Draft
ron-starkware wants to merge 1 commit into
Draft
Conversation
Support the `deploy_v2` syscall (same request/response layout as `deploy`, but the deployed address is derived with the BLAKE2s-with-Pedersen-image-escape derivation). Matches the `DeployV2` Sierra libfunc / `deploy_v2_syscall` corelib function added upstream in cairo (ron/deploy-v2/* stack). - Trait: `deploy_v2` required method on `StarknetSyscallHandler`, mirroring `deploy`. This fans out to every impl (the checklist below). - Runtime ABI: `deploy_v2` field in `StarknetSyscallHandlerCallbacks`, the `DEPLOY_V2` vtable offset, init, and `wrap_deploy_v2`. - MLIR: `DeployV2` dispatch arm + `build_deploy_v2`; the `build_deploy` body is shared via `build_deploy_impl(callback_offset)` (native dispatches by vtable offset, the only difference from `deploy`). Debug name maps updated. - Handlers: `DummySyscallHandler` (unimplemented), `StubSyscallHandler` (the real Blake-escaped derivation, matching the sequencer + cairo runner), the sierra-emu handler + `eval_deploy_v2` interpreter arm, and the example/test stubs. - Tests: the stub reproduces the five frozen §3.1 derivation vectors and the pedersen_reachable truth table; a JIT `deploy_v2` test asserts the syscall routes to the handler's `deploy_v2` (distinct address from `deploy`). Dep override: the `DeployV2` variant is not yet in a published cairo-lang-* release, so the version pins are bumped and a temporary `[patch.crates-io]` block redirects them to the local cairo checkout. Replace with a plain version bump once the variant is released. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
cairo_nativesupport for thedeploy_v2syscall (same request/response layout asdeploy, but the deployed address uses the BLAKE2s-with-Pedersen-image-escape derivation). Companion to the cairo compiler + corelib work (starkware-libs/cairo#10214 → #10215 → #10216) and the sequencerron/contract-address/*stack.deploy_v2required method onStarknetSyscallHandler, mirroringdeploy— fans out to every impl (the checklist below).deploy_v2field inStarknetSyscallHandlerCallbacks, theDEPLOY_V2vtable offset, init, andwrap_deploy_v2.DeployV2dispatch arm +build_deploy_v2;build_deploy's body is shared viabuild_deploy_impl(callback_offset)(native dispatches by vtable offset — the only difference fromdeploy). Debug name maps updated (main + sierra-emu).DummySyscallHandler(unimplemented),StubSyscallHandler(the real Blake-escaped derivation, matching the sequencer + cairo runner), the sierra-emu handler +eval_deploy_v2interpreter arm, and the example/test stubs.pedersen_reachabletruth table; a JITdeploy_v2test asserts the syscall routes to the handler'sdeploy_v2(returns a distinct address fromdeploy); sierra-emu covered.DeployV2Sierra variant isn't in a publishedcairo-lang-*release yet, so the version pins are bumped and a[patch.crates-io]block points at the cairoron/deploy-v2/compilerbranch (#10214). Replace with a plain version bump once the variant ships. (Runtime tests that compile Cairo also need a corelib carryingdeploy_v2_syscall, i.e. the vendored corelib bumped to that release.)🤖 Generated with Claude Code